<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script>

        function Car(){
            this.color = 'red';
            this.doors = 4;
            this.mpg = 23;
            this.showColor = function(){
                alert(this.color);
            };
        }

        let c = new Car();
        //c.showColor()

        //对Car的构造方法扩展新的方法
        Car.prototype.myFun = function () {
            alert(123)
        }

        c.myFun()
    </script>

</head>

<body>

</body>
</html>
